package com.zx.rbac.ums.service.impl;

import com.zx.rbac.ums.dao.UmsRoleDao;
import com.zx.rbac.ums.model.UmsRoleEntity;
import com.zx.rbac.ums.service.UmsRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("umsRoleService")
public class UmsRoleServiceImpl implements UmsRoleService {

    @Autowired
    private UmsRoleDao roleDao;

    @Override
    public List<UmsRoleEntity> selectByAdminId(Long id) {
        List<UmsRoleEntity> roleEntities = roleDao.selectByAdminId(id);
        return roleEntities;
    }

    @Override
    public void addMenuToRole(Long roleId, List<Long> menuIds) {
        //TODO 默认赋予该角色指定菜单的所有资源权限
        //TODO 向角色菜单关系表中插入数据
        //roleDao.addMenuToRole(roleId, menuIds);
        //TODO 向角色权限表中插入数据
    }
}
